package com.magicmovie.shiro;

import com.magicmovie.entity.Customer;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Component;

@Component
public class CurrentCustomerService {
    public Customer getCurrentCustomer(){
        Object principal = SecurityUtils.getSubject().getPrincipal();
        return (Customer) principal;
    }
}
